package com.nts.visionworks.business.application.domain;

// Generated 2013. 7. 18 ���� 5:59:34 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * ServiceApplication generated by hbm2java
 */
@Entity
@Table(name = "service_application", catalog = "visionworks")
public class ServiceApplication implements java.io.Serializable
{

	private Integer applicationId;
	private String applicationName;
	private Boolean usable;
	private Date createdDateTime;
	private long creatorId;
	private Date updatedDateTime;
	private Set<ApplicationSetting> applicationSettings = new HashSet<ApplicationSetting>(
			0);

	public ServiceApplication()
	{
	}

	public ServiceApplication(String applicationName, Date createdDateTime,
			long creatorId)
	{
		this.applicationName = applicationName;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
	}

	public ServiceApplication(String applicationName, Boolean usable,
			Date createdDateTime, long creatorId, Date updatedDateTime,
			Set<ApplicationSetting> applicationSettings)
	{
		this.applicationName = applicationName;
		this.usable = usable;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
		this.updatedDateTime = updatedDateTime;
		this.applicationSettings = applicationSettings;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ApplicationId", unique = true, nullable = false)
	public Integer getApplicationId()
	{
		return this.applicationId;
	}

	public void setApplicationId(Integer applicationId)
	{
		this.applicationId = applicationId;
	}

	@NotNull(message = "validation.serviceApplication.applicationName.notNull")
	@Size(message = "validation.serviceApplication.applicationName.length", max = 100, min = 1)
	@Column(name = "ApplicationName", nullable = false, length = 100)
	public String getApplicationName()
	{
		return this.applicationName;
	}

	public void setApplicationName(String applicationName)
	{
		this.applicationName = applicationName;
	}

	@Column(name = "Usable")
	public Boolean getUsable()
	{
		return this.usable;
	}

	public void setUsable(Boolean usable)
	{
		this.usable = usable;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", nullable = false, length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Column(name = "CreatorId", nullable = false)
	public long getCreatorId()
	{
		return this.creatorId;
	}

	public void setCreatorId(long creatorId)
	{
		this.creatorId = creatorId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@JsonIgnore
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "serviceApplication")
	public Set<ApplicationSetting> getApplicationSettings()
	{
		return this.applicationSettings;
	}

	public void setApplicationSettings(
			Set<ApplicationSetting> applicationSettings)
	{
		this.applicationSettings = applicationSettings;
	}

}
